The VideoToolbox is a collection of two hundred C subroutines and several demo and utility programs that I and others have written to do visual psychophysics with Macintosh computers. It's free and may not be sold without permission. It should be useful to anyone who wants to present accurately specified visual stimuli or use the Mac for psychometric experiments. The text file "Video synch" discusses all the ways of synchronizing programs to video displays and the many pitfalls to avoid. The TimeVideo application checks out the timing of all video devices in anticipation of their use in critical real-time applications, e.g. movies or lookup table animation. Low-level routines control video timing and lookup tables, display real-time movies, and implement the luminance-control algorithms suggested by Pelli and Zhang (1991). In particular, GetPixelsQuickly and SetPixelsQuickly peek and poke pixels in bitmaps and pixmaps, CopyBitsQuickly copies bit/pixmaps to the screen, and SetEntriesQuickly and GDSetEntries load the screen's color lookup table, all without any of QuickDraw's color translations. High-level routines help analyze psychophysical experiments (e.g. graphing or maximum-likelihood fitting of psychometric data). Assign.c is a runtime C interpreter for C assignment statements, which is useful for controlling experiments and sharing calibration data. This collection has been continually updated since 1991. Many colleagues have indicated that they are using the software in their labs. Documentation is in the source files themselves. Many of the routines are Mac-specific, but some very useful routines, e.g. the luminance-control, statistics, maximum-likelihood fitting algorithms, and the runtime interpreter are written in Standard C and will work on any computer. Those wishing to acknowledge use of the VideoToolbox software might cite:
Pelli, D. G. and Zhang, L. (1991) Accurate control of contrast on microcomputer displays. Vision Research, 31, 1337-1350. Reprints are available.
AVAILABILITY:
The VideoToolbox software is continually updated. To get the latest version, just send me your mailing address, and I'll mail you a disk. Or use ftp to download "info-mac/Development/SourceCode/video-toolbox. . . . " from sumex-aim.stanford.edu [36.44.0.6]. Log in as "anonymous"; any password will do. The gopher server is called Info-Mac Archives. If you can't do ftp, you can request a file by email; for instructions send a query to Info-Mac-Request@sumex-aim.stanford.edu. Or, if you're a member of CompuServe, download VIDEOT.SEA from Library 4 "C and Pascal" in the MacDev forum.
The ISR Video Attenuator is a commercial product. Ordering instructions are in the "Video attenuator" file. I have no financial involvement in the ISR Video Attenuator.
FREE SUBSCRIPTION:
Just send me your email address. Each time I post a new version of the VideoToolbox to the Info-Mac Archives, I'll send a copy (or just notification if you prefer) of the submission to everyone on the subscription list. The submission is a Binhexed Stuffit archive, about 2 MB. Please indicate whether you want the archive enclosed, or just want to be notified.
AUTHORS:
Denis Pelli (most of the routines)
David Brainard (a dozen or so routines in Assign.c, one in GDOpenWindow.c)
David Brainard & jms (GetTimeDateString.c)
Joseph Laffey (GetVersionString.c)
Raynald Comtois, Bill Haake, Peter Lennie (SetEntriesQuickly.c)
Mike Kahl (CopyQuickDrawGlobals.c)
Dave Radcliffe (FlushCacheRange.c)
Preeti Verghese (GetVoltage.c)
SPLAsh Resources (HideMenuBar.c)
Apple & Jamie R. McCarthy (IsCmdPeriod.c)
Mike Kahl & Evan Relkin (kbhit.c)
Mike Schechter (PixMapToPICT.c)
J.N. Little & jmb (ReadMATLABFile.c)
EJ Chichilniski (SetFileInfo.c)
SPLAsh Resources (SetMouse.c)
Bart Farell (several routines in SetOnePixel.c and SetPixelsQuickly.c)
Apple (TrapAvailable.c)
Apple (Zoom.c)
Detailed attribution appears in each file. Please advise of any errors or omissions.
MATLAB:
David Brainard (brainard@condor.psych.ucsb.edu) is presently creating interface files that make it easy to use the VideoToolbox from within MATLAB. If you're interested, contact him. Also see VideoToolboxMATLAB.c in VideoToolboxSources.
GETTING STARTED:
Try the demos: Sandstorm, Grating, FlickeringGrating, Filter, and TimeVideo. TimeVideo times all of your displays, telling you how quickly you can show movies and do lookup table animation. Read "Video synch" and "Advice".
Put the VideoToolbox folder anywhere on your hard disk. The key header files: VideoToolbox.h, VideoToolbox.pre, Luminance.h, mc68881.h, and TranslateLinefeeds.h should be in your THINK C folder (or any subfolder within it), so that THINK C can find them. The simplest way to achieve that is to place the entire VideoToolbox inside your THINK C folder. (The Symantec documents say this is a no-no, but it works fine.) Instead of copying source files to your projects, just "Add" them using the THINK C Source menu. That will make it easy to update the VideoToolbox.
Follow the instructions in VideoToolbox.c to precompile "VideoToolbox.h" to recreate the precompiled header "VideoToolbox.pre", since it must be produced by your version of the compiler. (If you're producing an external code resource for MATLAB then read VideoToolboxMATLAB.c instead.)
All the programs that do accurate luminance control use the monitor-calibration data stored in LuminanceRecord1.h or LuminanceRecord2.h (the number is a screen number, similar--but not identical--to the number that appears in the Monitors control panel). These calibration files describe my monitors (Apple High-Resolution Monochrome), and, naturally, before doing any serious data collection you should replace these files with ones that describe your own monitors. Use the CalibrateLuminance program. You'll need a photometer.
NUMERICAL RECIPES IN C:
A few programs in the VideoToolbox (CalibrateLuminance.c, PsychometricFit.c, and Quick3) use the (very handy) Numerical Recipes software and book. Required changes to these routines are described in the "Improve Numerical Recipes" document in the Notes folder. I have included pre-compiled CalibrateLuminance and Quick3 applications for users that don't have the Numerical Recipes. The Numerical Recipes C Set for Macintosh (main book, example book, and disk) costs $90 from:
Cambridge University Press
Orders Department
110 Midland Avenue
Port Chester, NY 10573
1-(800)-227-0247
VERSION OF THINK C:
I suggest that you upgrade to THINK C 6.01, which is what I use. In a pinch, you can use THINK C 5, but the upgrade is inexpensive and improves the user interface significantly. You cannot use any version of THINK C older than 5. At the moment, some of the VideoToolbox projects ".π5" are in version 5 and some ".π" are in version 6 format. THINK C 6 will read either format of project file (converting it to the new format), but THINK C 5 will say "Unknown error ID=-192" if you try to open a version 6 project.
BUGS & SUGGESTIONS:
It's unlikely that you'll find any bugs, but if you do, please send me email so we can fix 'em. Suggestions and code donations (i.e. C routines to be included in the VideoToolbox, possibly in modified form, with full attribution) are warmly appreciated.
denis_pelli@isr.syr.edu
CONTENTS OF THE VIDEOTOOLBOX DISK:
•Read me—this file.
•Advice—list of books and software to help in programming vision experiments.
•AllSources.π is a project file that allows your to browse through all the sources in the entire VideoToolbox disk, including demos and utilities. Double click the project to start up THINK C, then double click the name of any source file you want to examine.
•Changes—chronological list of additions and bug fixes.
•Demos—a folder containing a variety of ready-to-run applications demonstrating various features of the VideoToolbox software. Sources are included.
•Notes—improvements to THINK C and Numerical Recipes, documentation for Luminance.c, and explanations of video arcana collected from various sources.
•Portability-how to make your programs compatible with a wide range of Macs.
•TimeVideo tests all of your computer's built-in video, video cards, and video drivers. Highly recommended. Just double-click it.
•Utilities—a folder containing CalibrateLuminance and other useful ready-to-run projects.
•Video synch-explains how to synchronize a program to a video card.
•Video attenuator—ordering and installation instructions.
•VideoToolboxSources—a folder containing many useful subroutines. I suggest that you put the entire VideoToolbox folder inside your THINK C folder. (Or at least put the VideoToolboxSources folder there.) That will make it easier for your projects to access these routines without having to copy them into each of your project's folders. It will also make it much easier to update them, since all your programs will share the same copy.
CONTENTS OF Utilities FOLDER:
CalibrateLuminance helps you to measure the parameters of your video card, ISR Video Attenuator, and monitor. You will need a photometer. CalibrateLuminance will use a Data Translation FORERUNNER A/D card if you have one. All the results are stored in a "header" file called LuminanceRecord?.h, where ? stands for the screen number. You can then #include this file at compile time or ReadLuminanceRecord at run time in each of your programs that use that screen.
CheckContrast does a rigorous testing of the Pelli & Zhang (1991) algorithms that underlie the ISR Video attenuator and the Luminance.c software. You might find it useful if you want to test your ISR Video Attenuator and Luminance.c.
MeasureMTF measures your video monitor's Modulation Transfer Function, i.e. contrast gain as a function of spatial frequency.
Quick3 is a set of subroutines and a main program to fit psychometric functions. See:
Watson, A. B. (1979) Probability summation over time. Vision Res, 19, 515-22.
Watson, A. B. and Pelli, D. G. (1983) QUEST: a Bayesian adaptive psychometric method. Percept Psychophys, 33 (2), 113-20.
The CricketGraph files are format files that should be moved into the folder in which your CricketGraph application resides. When you start up CricketGraph it will find and load all the format files, so that later, when you want to plot data, these formats will be available in CricketGraph's Format menu. (Sorry, they don't work with the new CricketGraph III.)
GetVideoDrivers and GetSlotDrivers copy all drivers into resource files, for subsequent perusal in ResEdit, in case you want to enhance SetEntriesQuickly to support a new video device. This is discussed in the "Video synch" file.
CONTENTS OF VideoToolboxSources FOLDER:
Assign.c is a portable runtime C interpreter that reads and executes any text "assignment" file that contains only C assignments and comments, e.g.
viewingDistance=57.0; /* inches */
It uses an array of "Description" structures to associate each name in the assignment file with a runtime C variable. It can also write an assignment file, making the assignment file a portable way of writing and reading calibrations and experimental parameters. Arrays can be allocated dynamically, automatically dimensioned so as to hold all the assignments in any part of the assignment file. Programs written before 1993, using the old ReadAssignments.c (superceded by Assign.c), may include the header file Assign92.h to minimize the effort of updating.
Binomial.c, given a binomial sample, returns a confidence interval for the underlying binomial probability.
BreakLines.c takes a long C string and judiciously changes spaces to '\n' to yield lines shorter than a specified lineLength.
CardSlot.c finds the first NuBus slot that contains a card of the given name. Returns -1 if there's no such card.
CenterRectInRect.c, shifts the first rect to center it in the second. OffsetRectTile and RectInRect are trivial but handy routines for playing with rects.
ChiSquare.c, given a sample from a chi square distribution with n degrees of freedom, returns the significance level at which a fit may be rejected.
ConvolveX.c and ConvolveY allow convolution, vertically or horizontally, with an arbitrary one-dimensional point spread function. The source and destination Pixmaps may be the same or different, and may be the screen, so you can watch it happen. Try the demo Filter.
CopyBitsQuickly.c is a dumb substitute for CopyBits that ignores the color tables and palettes, simply copying pixels without any translation. It's for doing animations. Besides copying images, it can also add or multiply them. At one time it was much faster than CopyBits, but the latest timing (under System 7), by TimeVideo, indicates that CopyBits is now about as fast as CopyBitsQuickly. Try the demo Sandstorm.
CopyQuickDrawGlobals.c allows THINK C programs that use both the console and MacTraps to access the qd global structure.
DateString.c creates a unique string representing the date and time, suitable as an extension for a data file name.
DrawPrintf.c does a sprintf and draws the characters into the current port, using the current font etc. Try the demo TestGDVideo.
ffprintf.c prints to two output streams, usually stdout and a file. It also saves and restores the port and GDevice.
FlushCacheRange.c, from Apple, provides a machine-independent way of flushing your processor's instruction and data caches.
GDInfo.c and GDInfoTime fill the user-supplied VideoInfo record with descriptive information about the video device.
GDInfo.h is a header file that defines the VideoInfo structure used by GDInfo.c, GDTestClut.c, and TimeVideo.c.
GDOpenWindow1() opens a full screen color window with an explicit palette on an arbitrary screen . GDDisposeWindow1() closes the window and restore the screen's clut. AddExplicitPalette() adds a palette with all colors marked explicit to any color window or GWorld, allowing you to use PmForeColor or PmBackColor to designate the number you want to set pixels to when you use QuickDraw operations like EraseRect and DrawText. RemovePalette disposes of the palette. Try the demo Grating.
GDTestClut.c tests whether the video clut can be written and read faithfully, and saves the results in a user-supplied VideoInfo structure.
GDTime.c includes various routines that measure the timing of a video device. GDTimeClut measures how long it takes to load the clut. GDFrameRate measures the frame rate in Hz. GDVBLRate() measures the rate of VBL interrupts in Hz. GDMovieSize() measures what fraction of the screen you can fill with a real-time movie (a new image on each frame) using either CopyBitsQuickly or CopyBits to copy from memory to video card. Try the demo TimeVideo.
GDVideo.c allows you to control the video driver directly, bypassing QuickDraw. I consider this essential for controlling the lookup table of the video card.
GDCardName(device) returns a C string containing the name of the video card.
GDClutSize(device) returns the number of entries in the video driver's clut in the current video mode (i.e. current pixel size). VideoToolbox.h defines a preprocessor macro GDCLUTSIZE(device) that expands to equivalent inline code.
GDColors(device) returns the number of colors, in the current video mode.
GDDacSize(device) returns the number of bits in the video card's dac.
GDDirectSetEntries(device,start,count,table) loads the clut, if pixels are 16 or 32 bits.
GDGetEntries(device,start,count,table) reads the clut.
GDGetGamma(device,gammaTblHandle) returns a pointer to the device's Gamma table.
GDGetPageCnt(device,mode,&pages) tells you how many pages of video ram are available in any given mode.
GDHasMode(device,mode,&pixelSize,&pages) tells you whether a particular video mode is supported by your video device.
GDName(device) returns a Pascal string containing the name of the driver.
GDNewLinearColorTable(device) returns a default table for use when pixelSize is 16 or 32 bits.
GDPrintGammaTable().
GDRestoreDeviceClut(device) works more reliably than Apple's RestoreDeviceClut.
GDSaveGamma(device)/GDRestoreGamma(device) save/restore the driver's gamma-correction table.
GDSetEntries(device,start,count,table) loads the clut if pixels are 1 to 8 bits. Does a low-level setEntries Control call to the video card's driver, loading any number of clut entries with arbitrary rgb triplets.
GDSetEntriesByType(device,start,count,table) checks the device's gdType field
and calls GDSetEntries, GDDirectSetEntries, or nothing, as appropriate.
GDSetEntriesByType() while the processor priority has been temporarily raised to 7.
GDSetGamma(device,gamma) loads a Gamma table into the specified video device.
GDSetMode(device,mode,page,&baseAddr) changes the video card's mode (i.e. pixelSize) and page.
GDSetPageDrawn(device,page) selects which page of video memory will be used by future drawing operations. Untested.
GDSetPageShown(device,page) selects which page of video memory we see. Untested.
GDUncorrectedGamma(device) loads an identity matrix as the gamma-correction table.
GDVersion(device) returns the version number of the driver.
PatchMacIIciVideoDriver() fixes a bug in the Mac IIci built-in video driver.
Try the demos TimeVideo and TestGDVideo. See "Video synch".
GetClicks.c waits for a mouse click, and determines whether it's a single, double, or triple click.
GetScreenDevice.c returns a handle to the n-th screen, where the MainDevice is the zero-th screen. n=GetScreenIndex(device) returns the inverse of GetScreenDevice(). slot=GetDeviceSlot(device) gets the "slot" for any screen device. device=SlotToScreenDevice(n) returns a handle to the screen device in slot n. device=GetWindowDevice(window) returns GDHandle of screen with largest intersection with the window's content.
GetVersionString.c gets the application's version from its 'vers' resource.
GetVoltage.c reads a voltage from the Data Translation Analog to Digital Converter. This is used heavily by CalibrateLuminance, CheckContrast, and MeasureMTF. You may want to write an equivalent routine in order to use those programs with another Analog to Digital Converter.
HideMenuBar.c and SquareCorners(device) allow use of the whole screen. Try Grating.
Identify.c includes several functions, IdentifyCompiler(), IdentifyMachine(), and IdentifyVideo(), that produce self explanatory text strings to document test conditions, etc. Try the demos TimeCPU and TimeVideo.
IsCmdPeriod.c accepts an event record and returns true or false, indicating whether the user has hit command period. Should work even on international systems that do keyboard remapping, but that has yet to be tested.
IsNan.c allows you to test whether your double variable contains a Not A Number code instead of a legal number. IsNan() returns the index (1 . . . 255) of the NAN, or zero if it's not a NAN. IsInf() returns -1 for -INF, +1 for +INF, and zero for not ±INF. The extra-fast macro IsFinite() returns 1 if your number is neither NAN nor ±INF.
kbhit.c and getcharUnbuffered() offer old-fashioned microcomputer-style unbuffered access to keystrokes.
Log2L.c quickly returns the (long) integer part of the log2 of a long integer argument.
Luminance.c provides for programming of the lookup table for gamma correction, and use of a video attenuator. Its theory of operation is described by Pelli and Zhang (1991). Documentation is in Luminance.doc in the Notes folder. Try the demos FlickerGrating and Filter.
Luminance.h is the header file for use with Luminance.c.
LuminanceRecord1.h is a sample "header" file produced by CalibrateLuminance.c for one of my monitors. It describes the gamma function and the gains of the three channels of the ISR Video attenuator. You should run CalibrateLuminance to make your own for each of your monitors.
MakeNoise.c synthesizes random checkerboard movies. MakeNoise1 provides a simpler interface that allows you to specify whether or not to randomize phase. Try the demos Sandstorm and NoiseVBL.
MaximizeConsoleHeight.c causes the THINK C console to open to the full height of your main screen.
mc68881.h defines MPW C's mc68881 and mc68020 preprocessor symbols for THINK C, so your programs can use them in "if" statements without worrying about which compiler you're using. The symbols are 1 (i.e. true) if the compiled code requires the chip (or better) and 0 otherwise.
Mean.c computes mean (and optionally the standard deviation) of an array of samples (all doubles).
MultipleChoice.c, accepts one character response (with default) and spells out the whole answer. YesOrNo(), formerly in kbhit.c, accepts y/n and spells out "Yes" or "No".
Normal.c computes the probability density, cumulative distribution, and inverse cumulative distribution for the normal distribution.
nrand.c, nrandU(n), and nrandUL(n) return a random number in the range [0,n-1]. The type of the argument and returned value are both short, unsigned short, or unsigned long, respectively.
OpenDataFile.c opens a parameter file for input and a data file for output. Output file name includes a time stamp, making it unique.
OpenPreferencesFolder.c opens the Preferences folder in the System Folder, creating it if necessary.
PixMapToPICT.c saves a section of a PixMap as a PICT file.
PixMapToPostScript.c will convert a grayscale image to a postscript file suitable for printing on a LaserWriter or Linotype.
PlotXY.c is handy for a quick screen plot, especially of incoming data. It plots one point at a time, and does lines, in eight colors, with optional dashing, and optional symbols. Used by MeasureMTF for online display.
PrintfExit.c prints out an error message and exits.
QD32Exists.c determines whether 32-bit QuickDraw has been installed. QD8Exists() determines whether color QuickDraw is present. NewPaletteManager() determines whether the new palette manager (documented in Inside Mac volume VI) is present. These routines have no significant advantage over Apple's Gestalt(), which came later.
randU.c is a fast 16-bit random number generator. randUL() returns a 32-bit random number. (The Standard C rand() provides only 15 bits.) RandFill() quickly fills a buffer of any size with random bits. Used by MakeNoise. Try the demos Sandstorm, NoiseVBL, and TimeCPU.
ReadLuminanceRecord.c interprets a LuminanceRecord?.h at runtime, as an alternative to using the preprocessor #include mechanism at compile time.
ReadMATLABFile.c allows you to read and write MATLAB binary data files. MATLAB is a commercial application, sort of like BASIC rewritten by someone who likes linear algebra. ReadMATLABFile.c is based on code written by J.N. Little.
RectToAddress.c returns the memory address of the pixel in a PixMap or BitMap. ALWAYS works, dealing correctly with a whole slew of special configurations. Used by CopyBitsQuickly. GetPixBaseAddr32(PixMap **pm) returns the 32-bit address of the pixels/bits in a pix/bitmap. I suggest you call this instead of Apple's GetPixBaseAddr(), which gave wrong results in early version of 32-bit quickdraw.
Require.c tests for any required fpu, cpu, and version of QuickDraw, and tests for consistent sizeof int among the header, program, and Standard C library, and notifies the user and exits gracefully if any requirement is unmet. All the demos call Require().
RestoreCluts.c restores the Color Lookup Tables of all screens, to clean up when your program is done.
Sane.c has routines, DoubleToExtended() and ExtendedToDouble(), that convert back and forth between 12-byte and 10-byte floating point formats. The only reason for doing this would be to access numerical routines in Apple's SANE library.
SetEntriesQuickly.c, written primarily by Raynald Comtois, Peter Lennie, and Bill Haake, quickly loads the clut of many popular video cards. Try the demo TimeVideo.
SetFileInfo.c is a handy routine to set the creator and type of a file. The main use for this is to make data files of the correct type so that they can be double clicked and will open directly into the analysis program, typically Excel or Cricket Graph.
SetMouse.c moves the mouse. It complements the Apple-supplied GetMouse(). From THINKin' CaP, 1(2):28-29, Fall 1990.
SetOnePixel.c is obsolete; use SetPixelsQuickly instead, because it's ten times faster. The obsolete routines include GetOnePixel(), SetDevicePixel(), GetDevicePixel(), SetPixmapPixel(), GetPixmapPixel().
SetPixelsQuickly.c pokes or peeks a row of pixels, bypassing the color tables. This is the fastest way to get at the pixels in an image, for image processing or synthesis. All the routines work with both bitmaps and pixmaps and any size of pixel:1, 2, 4, 8, 16, or 32 bits. Try the demos Grating and FlickeringGrating.
SetPriority.c and SwapPriority() allow you to set the processor priority in order to prevent interrupts during something that you want to do as fast as possible, e.g. animations, and restore it later. Note that raising the processor priority will temporarily make the mouse and keyboard dead, because they are serviced by interrupts.
Shuffle.c randomly shuffles an array of shorts.
SndPlay1.c plays a sound asynchronously, i.e. it returns immediately, while the sound is still playing.
StringToDate.c reads date such as "6/30/91" and returns secs since 1/1/1904.
Timer.c is an interval timer based on Apple's Time Manager. StopTimer() returns the time, as a long, in µs that elapsed since calling StartTimer(). StopTimerSecs() returns the elapsed time as a double, in seconds. Try the demos TimeCPU and TimeVideo.
TitleBarHeight.c returns the height of a window's title bar, in pixels.
TrapAvailable.c, from Apple, determines whether a particular trap is available.
TranslateLinefeeds.c, and TranslateLinefeeds.h, are for MATLAB projects. They help make THINK C code modules compatible with the MPW stdio library.
Uniform.c: UniformSample() returns a random sample from the interval [0,1).
VBLInstall.c implements a once-per-video-frame interrupt suitable for use with all video devices. Try the demo TimeVideo.
VideoTFB.c allows direct control of the original Apple color video card, which is no longer sold by Apple but is available for $90 from Shreve Systems (800-227-3971). I wrote it based on my disassembly of the Apple video driver. Don't use these routines unless you're prepared to live with the resulting hardware dependency. VideoTFB works with both the "Toby frame buffer card" and the "Mac II High-Resolution Video Card". Try the demos ScrollDemo and TimeVideo.
VideoToolbox.h is the header file that has the prototypes for all the VideoToolbox routines except those in Luminance.c (whose headers are in Luminance.h) and Sane.c. VideoToolbox.h also defines a variety of useful pre-processor macros. TRUE and FALSE. Numerical constants: INF,NAN,PI,LOGPI,LOG2,LOG10. GDCLUTSIZE(device) expands to fast inline code that yields the same answer as GDClutSize(device). GDCOLORS(device) is gone because its answer was misleading when in 16-bit or 32-bit mode. Fixed point arithmetic: jf=LongToFix(j); j=FixToLong(jf); jf=DoubleToFix(a); a=FixToDouble(jf); StackGrow(n) increases the stack allocation by n bytes. You'll also want to use Apple's StackSpace(), declared in Memory.h, that returns the number of bytes allocated for the stack.
VLambda.c and VLambdaPrime(double nm) return the photopic and scotopic sensitivity of the standard CIE observer, relative to the peak at 555 or 507 nm. Based on Tables I(3.3.1) and I(4.3.2) in G. Wyszecki and W.S. Stiles (1982) Color Science, 2nd Ed., Wiley, New York.
Zoom.c implements a zoom box, i.e. if you click in the upper right hand corner of your window, in the little box-in-a-box icon, this code will expand the window to fill the screen with which it has the greatest intersection.
DISCLAIMER (included at the request of the MacPsych archive):
The VideoToolbox is provided "as is" without warranty of any kind. Denis Pelli, Syracuse University, SCiP, the operators of MacPsych, and St. Olaf College make no claims concerning the accuracy or correctness of the computer code contained in, or the results of the use of VideoToolbox. The entire risk as to the results and performance of VideoToolbox is assumed by you. If the VideoToolbox is defective you, and not Denis Pelli, Syracuse University, SCiP, the operators of MacPsych, or St. Olaf College assume the entire cost of all necessary servicing, repair or correction.